#include <stdio.h>
#include <string.h>

#define BUFFER_SIZE  10

//打印数组的值
//数组做函数的参数会自动弱化成指针
int prinfArray(int *array, int arraySize)
{
    int Len = sizeof(array);
    int len = sizeof(array[0]);
    int elementSize = Len / len;
    printf("printArray - elementSize:%d\n", elementSize);
}
int main()
{
    int array[BUFFER_SIZE];

    //清除脏数据
    memset(array, 0, sizeof(array));

    int Len = sizeof(array);
    int len = sizeof(array[0]);
    int elementSize = Len / len;
    printf("main - elementSize:%d\n", elementSize);

    //数组赋值
    for(int idx = 0; idx < BUFFER_SIZE; idx++)
    {
        array[idx] = (idx + 1) * 10;
    }

    //打印
    for(int idx = 0; idx < BUFFER_SIZE; idx++)
    {
        printf("array[%d] = %d\n", idx, array[idx]);
    }

    prinfArray(array, elementSize);
}
